Skip to content

feat: add coordinator/delegate expert separation#588

Merged
FL4TLiN3 merged 10 commits intomainfrom
feat/coordinator-delegate-separation
Feb 20, 2026
Merged

feat: add coordinator/delegate expert separation#588
FL4TLiN3 merged 10 commits intomainfrom
feat/coordinator-delegate-separation

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Introduce formal coordinator/delegate expert distinction based on naming convention (@scope/name for delegates)
  • Enforce delegation rules (no self-delegation, no out-of-scope delegates, no delegate-to-own-coordinator) via Zod schema superRefine on expertSchema
  • Provide type-specific meta-prompts: coordinators get parallelism, task-splitting, and delegation best practices; delegates get the existing thin tool-calling prompt
  • Rename all delegate experts in E2E configs and root perstack.toml to follow @coordinator/name convention
  • Remove old examples/ directory

Key changes

Area What changed
packages/core New expert-type.ts utilities + delegation validation in expertSchema via superRefine
packages/runtime Split getMetaInstruction() into coordinator/delegate variants
packages/skill-manager addDelegate callback validates delegation rules (only dynamic path not covered by schema)
E2E configs Delegates renamed to @coordinator/name pattern
perstack.toml Game team delegates renamed to @game-producer/*
examples/ Deleted

Delegation rules

Source → Target Allowed?
Coordinator → own scope delegate (game-producer@game-producer/designer) Yes
Coordinator → other coordinator (game-producerother-coordinator) Yes
Delegate → sibling delegate (@game-producer/designer@game-producer/programmer) Yes
Delegate → other coordinator (@game-producer/designerother-coordinator) Yes
Any → self No
Coordinator → out-of-scope delegate (game-producer@other/expert) No
Delegate → own coordinator (@game-producer/designergame-producer) No

Test plan

  • pnpm typecheck — 23/23 packages pass
  • pnpm test — 93 test files, 1153 tests pass (includes new expert-type + schema delegation tests)
  • pnpm format-and-lint — no new errors
  • pnpm build — 23/23 packages build
  • pnpm run validate:changeset — passes
  • pnpm test:e2e — requires API keys (CI)

🤖 Generated with Claude Code

FL4TLiN3 and others added 10 commits February 20, 2026 02:39
Introduce a formal distinction between coordinator and delegate experts
based on naming convention (@scope/name for delegates). Enforce delegation
rules via Zod schema validation and provide type-specific meta-prompts.

- Add expert-type utilities for classification and delegation validation
- Split meta-prompt: coordinators get parallelism/task-splitting guidance
- Validate delegation rules in expertSchema via superRefine
- Rename E2E and root config delegates to @coordinator/name convention
- Remove old examples directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…riter delegates

Replace the monolithic expert with a coordinator that orchestrates two
focused delegates: @expert/planner (designs architectures) and
@expert/definition-writer (writes and tests perstack.toml definitions).
Each delegate embeds deep Perstack best practices in its instruction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The coordinator expert key was "expert" instead of "create-expert",
inconsistent with the app name. Rename all expert keys and delegate
references accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ester

- Coordinator now only routes file paths between delegates, no domain logic
- Planner writes design to perstack/plan.md instead of returning as text
- Definition-writer reads plan file and writes perstack.toml (no testing)
- New @create-expert/expert-tester delegate handles all testing concerns
- Coordinator orchestrates: planner -> definition-writer -> expert-tester

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new skill management tool that loads experts from a perstack.toml
config file and adds them as delegates in a single step. Update
create-expert definitions to use this tool, simplify plan file paths,
and add workspace investigation guidance for delegates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Error nodes are terminal just like completed nodes, but flattenTree()
was only filtering out completed children. This caused stale failed
attempts to clutter the tree when a parent retried delegation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make stepNumber always start at 1 for each run, completing the
decoupling from the removed maxSteps feature. Accumulate totalSteps
across runs in the job instead.

- Rename createNextStepCheckpoint to createRunStartCheckpoint (stepNumber: 1)
- Reset stepNumber to 1 in delegation child/return checkpoints
- Accumulate job.totalSteps across runs (job.totalSteps + resultCheckpoint.stepNumber)
- Refresh job from storage after delegation to pick up child updates
- Replace stepNumber-based checkpoint sorting with file mtime
- Remove maxStepNumber parameter from TUI event fetching
- Fix log data-fetcher fallback to sum max stepNumber per runId
- Remove deleted --max-steps E2E test
- Fix create-expert E2E: update expertKey and tool name assertions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the feat/coordinator-delegate-separation branch from 762ea36 to ff355e8 Compare February 20, 2026 06:51
@FL4TLiN3 FL4TLiN3 merged commit 38848c0 into main Feb 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant